import { ref } from 'vue'
import { useStore } from '@/store'
// import useSlideHandler from '@/hooks/useSlideHandler'
// import { createRandomCode } from '@/utils/common'
// import { message } from 'ant-design-vue'
// import mammoth from 'mammoth'
import { MutationTypes } from '@/store/constants'

export default () => {
  const importing = ref(false)
  const store = useStore()

  const importWORD = (event: any) => {
    importing.value = true
  }

  const importJSON = (data: string) => {
    const slides = JSON.parse(data)
    store.commit(MutationTypes.SET_SLIDES, slides)

  }

  return {
    importing,
    importWORD,
    importJSON
  }
}